<div class="content">
    <!--- Bread Crumbs Menu -->
    <div class="breadLine">
        <ul class="breadcrumb">
            <li><a href="/">Admin</a> <span class="divider">></span></li>
            <li class="active"><a href="/">User</a> <span class="divider">></span></li>     
            <li class="active"><?php echo Config::get_page(); ?></li>
        </ul>
        <?php
            //echo $this->setLayout("breadcrumbs_right_menu");
        ?>
    </div>

   <div class="workplace">
        
    
        <div class="row-fluid">
            <div class="span12">
                <div class="head clearfix">
                    <div class="isw-calendar"></div>
                        <div class="span5">
                            <h1><?php echo Config::get_page(); ?></h1>
                        </div>
                        <div class="span3 pull-right"></div>
                    </div>
                    
                    <div class="row-fluid">
                        <div class="span12">
                            <div class="widget">
                                <div class="head dark">
                                    <div class="icon title_icon"><i class="fa fa-users"></i></div>
                                    <h2>Role And Access</h2>
                                </div>  
                                <div class="block-fluid">                    
                                    <ul class="nav nav-tabs">
                                        <li class="active" id="get_load_role"><a href="#tabs-access-role" data-toggle="tab"><i class="fa fa-plus"></i> Add / Update Access Role</a></li>
                                        <li id="get_load_department"><a href="#tabs-department-unit" data-toggle="tab"><i class="fa fa-plus"></i> Add / Update Department Unit</a></li>
                                        <li id="get_load_brand_category"><a href="#tabs-brand-category" data-toggle="tab"><i class="fa fa-plus"></i> Add / Update Brand Category</a></li>
                                    </ul>
                                    <div class="tab-content">
                                        <div class="tab-pane active" id="tabs-access-role">
                                            <div class="row-fluid">
                                                <div class="span5">
                                                    <span class="top title"><h4><text id="lbl_role">Add</text> Your Role:</h4></span>
                                                    <form id="add_role" class="formular" method="POST" action="/ajax/role-configuration?action=add_role&type=add">
                                                        <div class="row-form">
                                                            <div class="span3">Role Name*</div>
                                                            <div class="span9">
                                                                <input type="text" name="role_name" class="validate[required]" placeholder="Type a role name.">
                                                            </div>
                                                        </div>
                                                        <div class="toolbar bottom TAR">
                                                            <button class="btn btn-info" type="button" onclick="$('#add_role').validationEngine('hide');">Hide prompts</button>
                                                            <input type="submit" class="btn btn-primary" value="Add Role" id="new_role" />
                                                            <input type="submit" class="btn btn-primary hide" value="Update Role" id="update_role" data-id="" />
                                                        </div>
                                                    </form>
                                                </div>
                                                <div class="span7">
                                                    <span class="top title"><h4>List of Access Role:</h4></span>
                                                    <table class="tb_brochure" id="tbl_load_role" cellpadding="0" cellspacing="0" width="100%">
                                                        <thead>
                                                            <tr>
                                                                <th width="5%">#</th>
                                                                <th>Role Name</th>
                                                                <th class="TAC">Actions</th>
                                                            </tr>
                                                        </thead>
                                                    </table>       
                                                </div>
                                            </div>
                                        </div>
                                        <div class="tab-pane" id="tabs-department-unit">
                                            <div class="row-fluid">
                                                <div class="span5">
                                                    <span class="top title"><h4>Add Your Department:</h4></span>
                                                    <form id="add_department_unit" class="formular" method="POST" action="/ajax/role-configuration?action=add_department&type=add" enctype="multipart/form-data">
                                                        <div class="row-form">
                                                            <div class="span3">Department Name*</div>
                                                            <div class="span9">
                                                                <input type="text" name="department_name" class="validate[required]" placeholder="Type a department name.">
                                                            </div>
                                                        </div>
                                                        <div class="row-form">
                                                            <div class="span3">Access Role:*</div>
                                                            <div class="span9">
                                                                <select name="dep_access_role" class="validate[required]">
                                                                    <?php
                                                                        $db = new Database();
                                                                        $role_fs = new Role_Functions();
                                                                        echo $role_fs->load_roles($db,"");
                                                                    ?>                                                                    
                                                                </select>
                                                            </div>
                                                        </div>
                                                        <!--<div class="row-form">
                                                            <div class="span3">Access:*</div>
                                                            <div class="span9">
                                                                <input type="checkbox" name="dep_access[]" value="Read" class="validate[required]"/>Read 
                                                                <input type="checkbox" name="dep_access[]" value="Write" class="validate[required]"/> Write 
                                                            </div>
                                                        </div>-->
                                                        <div class="toolbar bottom TAR">
                                                            <button class="btn btn-info" type="button" onclick="$('#add_department_unit').validationEngine('hide');">Hide prompts</button>
                                                            <input type="submit" class="btn btn-primary" value="Add Department" />
                                                        </div>
                                                    </form>
                                                </div>
                                                <div class="span7">
                                                    <span class="top title"><h4>List of Department:</h4></span>
                                                    <table class="tb_brochure" id="tbl_load_department" cellpadding="0" cellspacing="0" width="100%">
                                                        <thead>
                                                            <tr>
                                                                <th width="5%">#</th>
                                                                <th>Department Name</th>
                                                                <th>Role Name</th>
                                                                <th class="TAC">Actions</th>
                                                            </tr>
                                                        </thead>
                                                        <tbody>
                                                            <?php
                                                                echo $role_fs->load_table_department($db);
                                                            ?>                          
                                                        </tbody>
                                                    </table>       
                                                </div>
                                            </div>
                                        </div>
                                        <div class="tab-pane" id="tabs-brand-category">
                                            <div class="row-fluid">
                                                <div class="span5">
                                                    <span class="top title"><h4>Add Your Category:</h4></span>
                                                    <form id="add_brand" class="formular" method="POST" action="/ajax/role-configuration?action=add_brand&type=add">
                                                        <div class="row-form">
                                                            <div class="span3">Brand Title</div>
                                                            <div class="span9">
                                                                <input type="text" name="brand_title" class="" placeholder="Type a brand title.">
                                                            </div>
                                                        </div>
                                                        <div class="row-form">
                                                            <div class="span3">Brand Category</div>
                                                            <div class="span9">
                                                                <input type="text" name="brand_category" class="validate[required]" placeholder="Type a brand category.">
                                                            </div>
                                                        </div>
                                                        <div class="row-form">
                                                            <div class="span3">Access Role:*</div>
                                                            <div class="span9">
                                                                <select name="brand_role" id="select_role" class="validate[required]">
                                                                    <?php
                                                                        $db = new Database();
                                                                        $role_fs = new Role_Functions();
                                                                        echo $role_fs->load_roles($db,"");
                                                                    ?>                                                                    
                                                                </select>
                                                            </div>
                                                        </div>
                                                        <div class="row-form">
                                                            <div class="span3">Department Unit:</div>
                                                            <div class="span9">
                                                                <select name="brand_department" id="chosen_department" class="validate[required]">
                                                                    <option value="">Select Role First</option>                                                                 
                                                                </select>
                                                            </div>
                                                        </div>
                                                        <div class="toolbar bottom TAR">
                                                            <button class="btn btn-info" type="button" onclick="$('#add_brand').validationEngine('hide');">Hide prompts</button>
                                                            <input type="submit" class="btn btn-primary" value="Add Brand Category" />
                                                        </div>
                                                    </form>
                                                </div>
                                                <div class="span7">
                                                    <span class="top title"><h4>List of Brand Category:</h4></span>
                                                    <table class="tb_brochure" cellpadding="0" cellspacing="0" width="100%">
                                                        <thead>
                                                            <tr>
                                                                <th width="5%">#</th>
                                                                <th>Role Name</th>
                                                                <th>Department Name</th>
                                                                <th>Brand Category Name</th>
                                                                <th class="TAC">Actions</th>
                                                            </tr>
                                                        </thead>
                                                        <tbody>
                                                            <?php
                                                                echo $role_fs->load_table_brand_category($db);
                                                            ?>                             
                                                        </tbody>
                                                    </table>       
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>  
                    </div>
                    
                </div>
            </div>    
        </div>

   </div>

</div>